<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <!--如果想在工具栏加入更多按钮，可以使用插槽方式， slot = 'left' or 'right'-->
      <crudOperation :permission="permission" />
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
          <el-form-item label="更改日期">
            <el-input v-model="form.bisZhsqRq" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="姓名">
            <el-input v-model="form.bisZhsqXm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="身份证">
            <el-input v-model="form.bisZhsqSfz" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="机构编码">
            <el-input v-model="form.bisZhsqJgbm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="机构名称">
            <el-input v-model="form.bisZhsqJgmc" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="更改原因">
            <el-input v-model="form.bisZhsqYy" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="bisZhsqXm" label="姓名" />
        <el-table-column prop="bisZhsqSfz" label="身份证" />
        <el-table-column prop="bisZhsqRq" label="更改日期" />
        <el-table-column prop="bisZhsqYy" label="更改原因" />
        <el-table-column prop="bisZhsqShr" label="审核人" />
        <el-table-column prop="bisZhsqShsj" label="审核时间" />
        <el-table-column prop="bisZhsqShjg" label="审核结果" />
        <el-table-column prop="bisZhsqJgbm" label="机构编码" />
        <el-table-column prop="bisZhsqJgmc" label="机构名称" />
        <el-table-column v-if="checkPer(['admin','zhsqTzdyrq:edit','zhsqTzdyrq:del'])" label="操作" width="150px" align="center">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            />
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudZhsqTzdyrq from '@/api/business/zhsqTzdyrq'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'

const defaultForm = { bisZhsqTzdyrqId: null, bisZhsqId: null, bisZhsqRq: null, bisZhsqYy: null, bisZhsqShr: null, bisZhsqShsj: null, bisZhsqShjg: null, bisZhsqXm: null, bisZhsqSfz: null, bisZhsqJgbm: null, bisZhsqJgmc: null, ywlx: null, lrr: null, lrrxm: null, lrbm: null, lrbmmc: null, lrsj: null, gxr: null, gxrxm: null, gxbm: null, gxbmmc: null, gxsj: null, sfyx: null, bz: null }
export default {
  name: 'ZhsqTzdyrq',
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '更新申请时间', url: 'api/zhsqTzdyrq', idField: 'bisZhsqTzdyrqId', sort: 'bisZhsqTzdyrqId,desc', crudMethod: { ...crudZhsqTzdyrq }})
  },
  data() {
    return {
      permission: {
        add: ['admin', 'zhsqTzdyrq:add'],
        edit: ['admin', 'zhsqTzdyrq:edit'],
        del: ['admin', 'zhsqTzdyrq:del']
      },
      rules: {
      }}
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }
  }
}
</script>

<style scoped>

</style>
